{template 'admin','header'}
<form name="searchform" action="{$self_url}" method="get">
<table cellpadding="0" cellspacing="1" class="table_list">
    <caption>关键字管理</caption>
    <tr>
        <td class="align_l">
            <a href="{$self_url}?action=add"><font color="red">添加关键字</font></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            关键字：<input type="text" id="searchword" name="word" size="10" value="{$word}" />
			<input type="submit" name="doquery" value="查询" id="doquery" class="button_style"/>
        </td>
    </tr>
</table>
</form>

<form method="post" name="myform" action="{$self_url}?action=delete_all" onsubmit="return r_submit(this);">
<table cellpadding="0" cellspacing="1" class="table_list">
    <caption>关键字列表</caption>
    <tr>
        <th width="60">选中</th>
        <th width="40%">关键字</th>
        <th width="40%">替换为</th>
        <th width="120">管理操作</th>
    </tr>
    {loop $data $r}
    <tr>
        <td class="align_c"><input type="checkbox" size="5" name="selected[]" value="{$r['id']}"></td>
        <td class="align_l">{$r['word']}</td>
        <td class="align_l">{$r['replace']}</td>
        <td class="align_c">
            <a href="{$self_url}?action=edit&id={$r['id']}">修改</a>&nbsp;|&nbsp;
            <a href="javascript:void(0)" onclick="my_request('{format_url("$self_url?action=delete&id=".$r['id'])}','确定要删除该关键字吗？')">删除</a>
        </td>
    </tr>
    {/loop}
</table>
<div class="button_box">
    <a href="javascript:void(0);" onclick="$('form[name=myform]').find('input:checkbox').attr('checked','true')">全选</a>/<a href="javascript:void(0);" onclick="$('form[name=myform]').find('input:checkbox').attr('checked','')">取消</a>
	<input type="button" value="批量删除" onclick="if(confirm('确定要删除选中的关键字？')){change_opt('myform','{$self_url}?action=delete_all');}" class="button_style">
</div>
<div id="pages">{$pages}</div>
</form>
{template 'admin','footer'}